package leetcode_2401_2500;

import java.util.HashSet;
import java.util.Set;

public class LeeCode_2441 {
    public static void main(String[] args) {

    }
    public int findMaxK(int[] nums) {
        int ans = -1;
        Set<Integer> set = new HashSet<>();
        for (int num : nums) {
            set.add(num);
        }
        for (int num : nums) {
            if (num < 0 && set.contains(-num)){
                ans = Math.max(-num, ans);
            }
        }
        return ans;
    }
}
